package com.smarthome.core.dictionary.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.smarthome.base.service.ShServiceTypeService;
import com.smarthome.core.dictionary.ServiceTypeService;
import com.smarthome.domain.bean.ShServiceType;
import com.smarthome.domain.vo.boss.DataGrid;
import com.smarthome.domain.vo.boss.PageHelper;

@Service("serviceTypeService")
public class ServiceTypeServiceImpl implements ServiceTypeService {

	@Resource
	private ShServiceTypeService shserviceTypeService;
	
	@Override
	public DataGrid queryDatagrid(ShServiceType queryServiceType,
			PageHelper page) {
		return shserviceTypeService.queryDatagrid(queryServiceType, page);
	}

	@Override
	public List<ShServiceType> queryServiceType(ShServiceType queryServiceType) {
		return shserviceTypeService.selectEntryList(queryServiceType);
	}

	@Override
	public ShServiceType queryServiceTypeById(Long id) {
		return shserviceTypeService.selectEntryById(id);
	}

	@Override
	public void add(ShServiceType serviceType) {
		shserviceTypeService.saveOrUpdate(serviceType);
	}

	@Override
	public void edit(ShServiceType serviceType) {
		shserviceTypeService.saveOrUpdate(serviceType);
	}

	@Override
	public void delete(Long id) {
		ShServiceType serviceType=shserviceTypeService.selectEntryById(id);
		serviceType.setIsDel(1L);
		shserviceTypeService.saveOrUpdate(serviceType);
	}

}
